<?php
include("../../inc/global.inc");
include("islogin.php");
$head['title']='申请产品款托管交易';	
$page = max(intval($_GET['page']),1);
$maxpage = 20;
include("top.php");
?>
<div class="con">
		   <div class="top5"><span>您当前位置：<a href="/help/">会员助手</a> &gt;&gt; 托管交易管理</span></div>
		   <?php include("left.php");?>
		   <div class="right">
		      <div class="y_5"></div>
		       <div class="con-tt"><span>申请产品款托管交易管理</span></div>
			   <div class="con-t1"><span></span></div>
			   <div class="con-t2">
<table width="100%" cellspacing="1" bgcolor="#C1DCF5">
        <tr>
          <td width="5%" height="30" align="center" bgcolor="#EFF6FF">编号</td>
          <td width="20%" align="center" bgcolor="#EFF6FF">产品名称</td>
          <td width="12%" align="center" bgcolor="#EFF6FF">申请时间</td>
          <td width="12%" align="center" bgcolor="#EFF6FF">买家</td>
          <td  align="center" bgcolor="#EFF6FF">管理操作</td>
        </tr>
		<?php
			$where ="where userid2=".$_COOKIE['user_id'] ;
			$sql="select * from sd_tuoguan $where order by id desc limit ".($page-1)*$maxpage.",$maxpage";
			$rows=$db->select($sql);
			$i=1;
			foreach($rows as $k=>$row)
			{
		?>
        <tr>
          <td height="22" align="center" bgcolor="#FFFFFF"><?=$row['id']?></td>
          <td align="center" bgcolor="#FFFFFF"><a href="<?=$row['url']?>" target="_blank"><?=$row['title']?></a></td>
          <td align="center" bgcolor="#FFFFFF"><?=date("Y-m-d",$row['inputtime'])?></td>
          <td align="center" bgcolor="#FFFFFF"><?=$row['username']?></td>
          <td align="center" bgcolor="#FFFFFF">
		  <?php 
		  if($row['status']==7)
		  {
		  	echo '交易关闭';
		  }
		  elseif($row['status']==0)
		  {
		  ?>
          <a href="queding.php?id=<?php echo $row['id'];?>" target="_blank">确定托管交易</a>
		  <?php 
		  }
		  elseif($row['status']==1)
		  {
		  
          	echo '等待买家打款';
          }
		  elseif($row['status']==2)
		  {
		  
          	echo '买家已打款，等待管理员确认。';
          }
		  elseif($row['status']==3)
		  {
		  
          	echo '<a href="fahuo.php?id='.$row['id'].'" target="_blank">请填写发货信息</a>';
          }
		  elseif($row['status']==4)
		  {
		  
          	echo '等待买家确认';
          }
		  elseif($row['status']==5)
		  {
		  
          	echo '买家已确认收货，等待三帝贸易网转账！';
          }
		  elseif($row['status']==6)
		  {
          	echo '<a href="maijiachengongjiaoyi1.php?id='.$row['id'].'" target="_blank">交易成功</a>';
          }
		  ?>
          </td>
        </tr>
<?php
$i++;
}
$number = $db->get_one("SELECT count(*) AS `count` FROM `sd_tuoguan` $where");
?>

        <tr>
          <td colspan="6" align="center" bgcolor="#FFFFFF" height="18">
          <?php echo showpages($number['count'], $page, $maxpage);?>          </td>
        </tr>
    </table>
               </div>
		 </div>
		 <div class="cl"></div>
</div> 
<?php include("foot.php");?>